package com.bit.www;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: lenovo
 * Date: 2022-07-15
 * Time: 14:54
 */
class Student implements Cloneable{
    public int age;

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
public class Test {
    public static void main(String[] args) throws CloneNotSupportedException {
     Student student = new Student();
     //编译时报错：
        //Error:(17, 35) java: 未报告的异常错误java.lang.CloneNotSupportedException; 必须对其进行捕获或声明以便抛出
        Student student1;
        student1 = (Student)student.clone();
    }
}
